<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<%
	String bgColor = request.getParameter("bgColor");
	boolean givenColor;

	if (bgColor == null) {
		bgColor = "white";
		givenColor = false;
	} else {
		givenColor = true;
	}
%>

<body bgcolor="<%=bgColor%>">
	<h1>背景色测试</h1>

	<%
		if (givenColor) {
			out.println("背景颜色已改为指定颜色");
		} else {
			out.println("没有指定背景颜色，已默认为白色，请在访问地址后加?bgColor=(你自己的颜色)");
		}
	%>
</body>
</html>